GtkWindow: Add a getter for the custom titlebar
authorMatthias Clasen <mclasen@redhat.com>
Sat, 18 Oct 2014 16:42:29 +0000 (12:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 18 Oct 2014 16:51:30 +0000 (12:51 -0400)
This is needed for the glade integration of CSD windows.

docs/reference/gtk/gtk3-sections.txt
gtk/gtkwindow.c
gtk/gtkwindow.h

index cf16a5b33e970a221d8d4448c08f8a3156c97626..570832eb21cb33696004d1ae9bcc127ec4ac17be 100644 (file)
@@ -5741,6 +5741,7 @@ gtk_window_get_application
 gtk_window_set_application
 gtk_window_set_has_user_ref_count
 gtk_window_set_titlebar
+gtk_window_get_titlebar
 gtk_window_set_interactive_debugging
 
 <SUBSECTION Standard>
index d177b23cf7a20cdef5b095ae3a2511968733c4de..23285914828e324f974926d01767400fd2a0638f 100644 (file)
@@ -4007,6 +4007,31 @@ out:
     gtk_widget_map (widget);
 }
 
+/**
+ * gtk_window_get_titlebar:
+ * @window: a #GtkWindow
+ *
+ * Returns the custom titlebar that has been set with
+ * gtk_window_set_titlebar().
+ *
+ * Returns: (transfer none): the custom titlebar, or %NULL
+ *
+ * Since: 3.16
+ */
+GtkWidget *
+gtk_window_get_titlebar (GtkWindow *window)
+{
+  GtkWindowPrivate *priv = window->priv;
+
+  g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
+
+  /* Don't return the internal titlebar */
+  if (priv->title_box == priv->titlebar)
+    return NULL;
+
+  return priv->title_box;
+}
+
 gboolean
 _gtk_window_titlebar_shows_app_menu (GtkWindow *window)
 {
index 687b312ba513bbda91723aeb223b1edc1b383376..4d97020ea878601195daed76582a350aa683ef52 100644 (file)
@@ -482,6 +482,8 @@ gboolean gtk_window_get_resize_grip_area   (GtkWindow    *window,
 GDK_AVAILABLE_IN_3_10
 void     gtk_window_set_titlebar           (GtkWindow    *window,
                                             GtkWidget    *titlebar);
+GDK_AVAILABLE_IN_3_16
+GtkWidget *gtk_window_get_titlebar         (GtkWindow    *window);
 
 GDK_AVAILABLE_IN_3_12
 gboolean gtk_window_is_maximized           (GtkWindow    *window);